<!DOCTYPE html>
<html lang=zh>
<head>
    <meta charset="utf-8">
    
    <title>centos7安装ngrok搭建内网穿透服务 | wyd个人博客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="ngrok 搭建内网穿透服务首先安装go 和 git1yum install -y golang git">
<meta name="keywords" content="linux,ngrok">
<meta property="og:type" content="article">
<meta property="og:title" content="centos7安装ngrok搭建内网穿透服务">
<meta property="og:url" content="http://yoursite.com/2018/08/07/centos7安装ngrok/index.html">
<meta property="og:site_name" content="wyd个人博客">
<meta property="og:description" content="ngrok 搭建内网穿透服务首先安装go 和 git1yum install -y golang git">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-01-02T06:50:56.888Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="centos7安装ngrok搭建内网穿透服务">
<meta name="twitter:description" content="ngrok 搭建内网穿透服务首先安装go 和 git1yum install -y golang git">
    

    
        <link rel="alternate" href="/" title="wyd个人博客" type="application/atom+xml" />
    

    

    <link rel="stylesheet" href="/blog-web/libs/font-awesome5/css/fontawesome.min.css">
    <link rel="stylesheet" href="/blog-web/libs/font-awesome5/css/fa-brands.min.css">
    <link rel="stylesheet" href="/blog-web/libs/font-awesome5/css/fa-solid.min.css">
    <link rel="stylesheet" href="/blog-web/libs/open-sans/styles.css">
    <link rel="stylesheet" href="/blog-web/libs/source-code-pro/styles.css">

    <link rel="stylesheet" href="/blog-web/css/style.css">

    <script src="/blog-web/libs/jquery/2.1.3/jquery.min.js"></script>
    
    
        <link rel="stylesheet" href="/blog-web/libs/lightgallery/css/lightgallery.min.css">
    
    
        <link rel="stylesheet" href="/blog-web/libs/justified-gallery/justifiedGallery.min.css">
    
    
    
    
        <script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?ec062deffd7b406d3f1529d20e4f68a7";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>

    


</head>

<body>
    <div id="container">
        <header id="header">
    <div id="header-main" class="header-inner">
        <div class="outer">
            <a href="/blog-web/" id="logo">
                <i class="logo"></i>
                <span class="site-title">wyd个人博客</span>
            </a>
            <nav id="main-nav">
                
                    <a class="main-nav-link" href="/blog-web/.">Home</a>
                
                    <a class="main-nav-link" href="/blog-web/archives">归档</a>
                
                    <a class="main-nav-link" href="/blog-web/categories">类别</a>
                
                    <a class="main-nav-link" href="/blog-web/tags">标签</a>
                
                    <a class="main-nav-link" href="/blog-web/about">关于</a>
                
            </nav>
            
                
                <nav id="sub-nav">
                    <div class="profile" id="profile-nav">
                        <a id="profile-anchor" href="javascript:;">
                            <img class="avatar" src="/blog-web/css/images/avatar.png" />
                            <i class="fas fa-caret-down"></i>
                        </a>
                    </div>
                </nav>
            
            <div id="search-form-wrap">

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
        <button type="submit" class="search-form-submit"></button>
    </form>
    <div class="ins-search">
    <div class="ins-search-mask"></div>
    <div class="ins-search-container">
        <div class="ins-input-wrapper">
            <input type="text" class="ins-search-input" placeholder="想要查找什么..." />
            <span class="ins-close ins-selectable"><i class="fas fa-times-circle"></i></span>
        </div>
        <div class="ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/blog-web/',
        CONTENT_URL: '/blog-web/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>
<script src="/blog-web/js/insight.js"></script>

</div>
        </div>
    </div>
    <div id="main-nav-mobile" class="header-sub header-inner">
        <table class="menu outer">
            <tr>
                
                    <td><a class="main-nav-link" href="/blog-web/.">Home</a></td>
                
                    <td><a class="main-nav-link" href="/blog-web/archives">归档</a></td>
                
                    <td><a class="main-nav-link" href="/blog-web/categories">类别</a></td>
                
                    <td><a class="main-nav-link" href="/blog-web/tags">标签</a></td>
                
                    <td><a class="main-nav-link" href="/blog-web/about">关于</a></td>
                
                <td>
                    
    <div class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
    </div>

                </td>
            </tr>
        </table>
    </div>
</header>

        <div class="outer">
            
                

<aside id="profile" class="profile-fixed">
    <div class="inner profile-inner">
        <div class="base-info profile-block">
            <img id="avatar" src="/blog-web/css/images/avatar.png" />
            <h2 id="name">wangYuDong</h2>
            <h3 id="title">Web Developer &amp; Designer</h3>
            <span id="location"><i class="fas fa-map-marker-alt" style="padding-right: 5px"></i>ChongQin, China</span>
            <a id="follow" target="_blank" href="https://gitee.com/wydcn">关注我</a>
        </div>
        <div class="article-info profile-block">
            <div class="article-info-block">
                4
                <span>文章</span>
            </div>
            <div class="article-info-block">
                9
                <span>标签</span>
            </div>
        </div>
        
        <div class="profile-block social-links">
            <table>
                <tr>
                    
                    
                    <td>
                        <a href="http://github.com/ppoffice/hexo-theme-icarus" target="_blank" title="github" class=tooltip>
                            <i class="fab fa-github"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/blog-web/" target="_blank" title="twitter" class=tooltip>
                            <i class="fab fa-twitter"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/blog-web/" target="_blank" title="facebook" class=tooltip>
                            <i class="fab fa-facebook"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/blog-web/" target="_blank" title="dribbble" class=tooltip>
                            <i class="fab fa-dribbble"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/blog-web/" target="_blank" title="rss" class=tooltip>
                            <i class="fab fa-rss"></i>
                        </a>
                    </td>
                    
                </tr>
            </table>
        </div>
        
    </div>
</aside>

            
            <section id="main"><article id="post-centos7安装ngrok" class="article article-type-post" itemscope itemprop="blogPost">
    <div class="article-inner">
        
        
            <header class="article-header">
                
    
        <h1 class="article-title" itemprop="name">
            centos7安装ngrok搭建内网穿透服务
        </h1>
    

                
                    <div class="article-meta">
                        
    <div class="article-date">
        <i class="fas fa-calendar-alt"></i>
        <a href="/blog-web/2018/08/07/centos7安装ngrok/">
            <time datetime="2018-08-07T02:06:54.000Z" itemprop="datePublished">2018-08-07</time>
        </a>
    </div>


                        
                        
    <div class="article-tag">
        <i class="fas fa-tag"></i>
        <a class="tag-link" href="/blog-web/tags/linux/">linux</a>, <a class="tag-link" href="/blog-web/tags/ngrok/">ngrok</a>
    </div>

                    </div>
                
            </header>
        
        
        <div class="article-entry" itemprop="articleBody">
        
            
            <h1 id="ngrok-搭建内网穿透服务"><a href="#ngrok-搭建内网穿透服务" class="headerlink" title="ngrok 搭建内网穿透服务"></a>ngrok 搭建内网穿透服务</h1><h2 id="首先安装go-和-git"><a href="#首先安装go-和-git" class="headerlink" title="首先安装go 和 git"></a>首先安装go 和 git</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install -y golang git</span><br></pre></td></tr></table></figure>
<a id="more"></a>
<h2 id="git-clone"><a href="#git-clone" class="headerlink" title="git clone"></a>git clone</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone https://github.com/tutumcloud/ngrok.git ngrok</span><br></pre></td></tr></table></figure>
<h2 id="配置域名"><a href="#配置域名" class="headerlink" title="配置域名"></a>配置域名</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd ngrok</span><br><span class="line">NGROK_DOMAIN=&quot;imshow.vip&quot;</span><br></pre></td></tr></table></figure>
<h2 id="生成ssl"><a href="#生成ssl" class="headerlink" title="生成ssl"></a>生成ssl</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">NGROK_DOMAIN=&quot;imshow.vip&quot;</span><br><span class="line">openssl genrsa -out base.key 2048</span><br><span class="line"></span><br><span class="line">openssl req -new -x509 -nodes -key base.key -days 10000 -subj &quot;/CN=$NGROK_DOMAIN&quot; -out base.pem</span><br><span class="line"></span><br><span class="line">openssl genrsa -out server.key 2048</span><br><span class="line"></span><br><span class="line">openssl req -new -key server.key -subj &quot;/CN=$NGROK_DOMAIN&quot; -out server.csr</span><br><span class="line"></span><br><span class="line">openssl x509 -req -in server.csr -CA base.pem -CAkey base.key -CAcreateserial -days 10000 -out server.crt</span><br></pre></td></tr></table></figure>
<h2 id="替换证书"><a href="#替换证书" class="headerlink" title="替换证书"></a>替换证书</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp base.pem assets/client/tls/ngrokroot.crt</span><br></pre></td></tr></table></figure>
<h2 id="编译服务端客户端"><a href="#编译服务端客户端" class="headerlink" title="编译服务端客户端"></a>编译服务端客户端</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">make release-server</span><br></pre></td></tr></table></figure>
<h2 id="启动服务端"><a href="#启动服务端" class="headerlink" title="启动服务端"></a>启动服务端</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./bin/ngrokd -tlsKey=server.key -tlsCrt=server.crt -domain=&quot;imshow.vip&quot; -httpAddr=&quot;:10080&quot; -httpsAddr=&quot;:10443&quot;</span><br></pre></td></tr></table></figure>
<h2 id="win客服端"><a href="#win客服端" class="headerlink" title="win客服端"></a>win客服端</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">GOOS=windows GOARCH=amd64 make release-client</span><br></pre></td></tr></table></figure>
<h2 id="配置文档"><a href="#配置文档" class="headerlink" title="配置文档"></a>配置文档</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">server_addr: &quot;imshow.vip:4443&quot;  </span><br><span class="line">trust_host_root_certs: false</span><br></pre></td></tr></table></figure>
<h2 id="startBat"><a href="#startBat" class="headerlink" title="startBat"></a>startBat</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@echo on</span><br><span class="line">cd %cd%</span><br><span class="line">#ngrok -proto=tcp 22</span><br><span class="line">#ngrok start web</span><br><span class="line">ngrok -config=ngrok.cfg -log=ngrok.log -subdomain=wxdev 9999</span><br></pre></td></tr></table></figure>
        
        </div>
        <footer class="article-footer">
            <div class="share-container">



</div>

    <a data-url="http://yoursite.com/2018/08/07/centos7安装ngrok/" data-id="cjs6w3gxz0001vct869919yhb" class="article-share-link"><i class="fas fa-share"></i>分享到</a>
<script>
    (function ($) {
        // Prevent duplicate binding
        if (typeof(__SHARE_BUTTON_BINDED__) === 'undefined' || !__SHARE_BUTTON_BINDED__) {
            __SHARE_BUTTON_BINDED__ = true;
        } else {
            return;
        }
        $('body').on('click', function() {
            $('.article-share-box.on').removeClass('on');
        }).on('click', '.article-share-link', function(e) {
            e.stopPropagation();

            var $this = $(this),
                url = $this.attr('data-url'),
                encodedUrl = encodeURIComponent(url),
                id = 'article-share-box-' + $this.attr('data-id'),
                offset = $this.offset(),
                box;

            if ($('#' + id).length) {
                box = $('#' + id);

                if (box.hasClass('on')){
                    box.removeClass('on');
                    return;
                }
            } else {
                var html = [
                    '<div id="' + id + '" class="article-share-box">',
                        '<input class="article-share-input" value="' + url + '">',
                        '<div class="article-share-links">',
                            '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="fab fa-twitter article-share-twitter" target="_blank" title="Twitter"></a>',
                            '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="fab fa-facebook article-share-facebook" target="_blank" title="Facebook"></a>',
                            '<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="fab fa-pinterest article-share-pinterest" target="_blank" title="Pinterest"></a>',
                            '<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="fab fa-google article-share-google" target="_blank" title="Google+"></a>',
                        '</div>',
                    '</div>'
                ].join('');

              box = $(html);

              $('body').append(box);
            }

            $('.article-share-box.on').hide();

            box.css({
                top: offset.top + 25,
                left: offset.left
            }).addClass('on');

        }).on('click', '.article-share-box', function (e) {
            e.stopPropagation();
        }).on('click', '.article-share-box-input', function () {
            $(this).select();
        }).on('click', '.article-share-box-link', function (e) {
            e.preventDefault();
            e.stopPropagation();

            window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
        });
    })(jQuery);
</script>

            
    
        <a href="http://yoursite.com/2018/08/07/centos7安装ngrok/#comments" id="sourceId::2018/08/07/centos7安装ngrok/" class="article-comment-link cy_cmt_count">评论</a>
    

        </footer>
    </div>
    
        
<nav id="article-nav">
    
    
        <a href="/blog-web/2018/08/04/centos7切换用户失败-资源不足/" id="article-nav-older" class="article-nav-link-wrap">
            <strong class="article-nav-caption">下一篇</strong>
            <div class="article-nav-title">centos7切换用户失败,资源不足</div>
        </a>
    
</nav>


    
</article>


    
    
        <section id="comments">
    <div id="SOHUCS" sid="2018/08/07/centos7安装ngrok/"></div>
</section>
    

</section>
            
                
<aside id="sidebar">
   
        
    
        
    <div class="widget-wrap">
        <h3 class="widget-title">归档</h3>
        <div class="widget">
            <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/blog-web/archives/2018/08/">八月 2018</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog-web/archives/2018/07/">七月 2018</a><span class="archive-list-count">2</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签</h3>
        <div class="widget">
            <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/error/">error</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/linux/">linux</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/ngrok/">ngrok</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/ribbon/">ribbon</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/shell/">shell</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/springCloud/">springCloud</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/ssh/">ssh</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/zuul/">zuul</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog-web/tags/转载/">转载</a><span class="tag-list-count">2</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签云</h3>
        <div class="widget tagcloud">
            <a href="/blog-web/tags/error/" style="font-size: 20px;">error</a> <a href="/blog-web/tags/linux/" style="font-size: 20px;">linux</a> <a href="/blog-web/tags/ngrok/" style="font-size: 10px;">ngrok</a> <a href="/blog-web/tags/ribbon/" style="font-size: 10px;">ribbon</a> <a href="/blog-web/tags/shell/" style="font-size: 15px;">shell</a> <a href="/blog-web/tags/springCloud/" style="font-size: 10px;">springCloud</a> <a href="/blog-web/tags/ssh/" style="font-size: 15px;">ssh</a> <a href="/blog-web/tags/zuul/" style="font-size: 10px;">zuul</a> <a href="/blog-web/tags/转载/" style="font-size: 15px;">转载</a>
        </div>
    </div>

    
        
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">链接</h3>
        <div class="widget">
            <ul>
                
                    <li>
                        <a href="http://hexo.io">Hexo</a>
                    </li>
                
            </ul>
        </div>
    </div>


    
    <div id="toTop" class="fas fa-angle-up"></div>
</aside>

            
        </div>
        <footer id="footer">
    <div class="outer">
        <div id="footer-info" class="inner">
            &copy; 2019 wangyudong<br>
            Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>. Theme by <a href="http://github.com/ppoffice">PPOffice</a>
        </div>
    </div>
</footer>
        
    
    <script id="cy_cmt_num" src="https://changyan.sohu.com/upload/plugins/plugins.list.count.js?clientId=cytIDoAP6"></script>
    <script charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/changyan.js" ></script>
    <script type="text/javascript">
    window.changyan.api.config({
    appid: 'cytIDoAP6',
    conf: '1fe9583cce0eb834c7f69c03a979fa4f'
    });
    </script>




    
        <script src="/blog-web/libs/lightgallery/js/lightgallery.min.js"></script>
        <script src="/blog-web/libs/lightgallery/js/lg-thumbnail.min.js"></script>
        <script src="/blog-web/libs/lightgallery/js/lg-pager.min.js"></script>
        <script src="/blog-web/libs/lightgallery/js/lg-autoplay.min.js"></script>
        <script src="/blog-web/libs/lightgallery/js/lg-fullscreen.min.js"></script>
        <script src="/blog-web/libs/lightgallery/js/lg-zoom.min.js"></script>
        <script src="/blog-web/libs/lightgallery/js/lg-hash.min.js"></script>
        <script src="/blog-web/libs/lightgallery/js/lg-share.min.js"></script>
        <script src="/blog-web/libs/lightgallery/js/lg-video.min.js"></script>
    
    
        <script src="/blog-web/libs/justified-gallery/jquery.justifiedGallery.min.js"></script>
    
    



<!-- Custom Scripts -->
<script src="/blog-web/js/main.js"></script>

    </div>
</body>
</html>